package com.beiye.drivertransport.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.beiye.drivertransport.R;
import com.beiye.drivertransport.bean.CourseSuperBean;

/**
 * Created by ky on 2018/1/11.
 */

public class CourseSuperAdatper extends ListBaseAdapter<CourseSuperBean.RowsBean> {

    protected Context context = null;
    public CourseSuperAdatper(Context context){
        super(context);
        this.context = context;
    }

    @Override
    public int getLayoutId() {
        return R.layout.course_item_layout;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        CourseSuperBean.RowsBean rowsBean = getDataList().get(position);

        ImageView img_course =  holder.getView(R.id.img_course);
        TextView tv_title = holder.getView(R.id.tv_course);
        TextView tv_coursetime = holder.getView(R.id.tv_course2);
    //    TextView tv_num = holder.getView(R.id.tv_course3);
     //   ImageView tv_courseno = holder.getView(R.id.tv_course5);
     //   TextView tv_courseyes = holder.getView(R.id.tv_course6);
        tv_title.setText(rowsBean.getCourseName());
        tv_coursetime.setText("课程时长:"+rowsBean.getCourseLength()+"分");
    //    tv_num.setText("已读次数:"+rowsBean.getReadNo()+"次");
//        if(rowsBean.getStudyState()==0)
//        {
//
//         //   tv_courseno.setImageResource(R.mipmap.wxx);
//            img_course.setImageResource(R.mipmap.icon_kccs_03);
//        }else if(rowsBean.getStudyState()==1)
//        {
//       //     tv_courseno.setImageResource(R.mipmap.yxx);
//            img_course.setImageResource(R.mipmap.icon_kccs_06);
//        }
//        if(rowsBean.getMrMark()==0)
//        {
//            tv_courseyes.setVisibility(View.INVISIBLE);
//        }else if(rowsBean.getMrMark()==1)
//        {
//            tv_courseyes.setVisibility(View.VISIBLE);
//            tv_courseyes.setText("必学");
//        }



        //   Picasso.with(context).load(Uri.parse(AppInterfaceConfig.getRequestUrl(rowsBean.getTopPicUrl()))).placeholder(R.mipmap.no_data).into(img_course);//加载图片


    }




}